import request from "../../http";

const loginApi = {
  async getQrcode() {
    return request({
      url: "/api/wechat/qrCode",
      method: "post"
    });
  },
  async unbindWechat() {
    return request({
      url: "/api/wechat/unBundling",
      method: "post"
    });
  },
  async scan(query) {
    return request({
      url: "/api/wechat/check/scan",
      method: "get",
      params: query
    });
  },
  async getInfo() {
    return request({
      url: `/pc/user/getUserInfo`,
      method: "get"
    });
  },
  async ifBindPhone(query) {
    return request({
      url: `/api/wechat/check/bind`,
      method: "get",
      params: query
    });
  },
  async bindPhone(query) {
    return request({
      url: "/api/wechat/bind/phone",
      method: "post",
      params: query
    });
  },
  async sendCode(query) {
    return request({
      url: "/api/send",
      method: "post",
      data: query
    });
  },
  async checkCode(params) {
    return request({
      url: "/api/checkSend",
      method: "post",
      data: params
    });
  },


  checkSendCode(params) {
    return request({
      url: "/api/checkSend",
      method: "post",
      data: params
    });
  },
  async login(params) {
    return request({
      url: "/api/user/register",
      method: "post",
      data: params
    });
  }
};

export default loginApi;
